import request from '@/utils/request.js'

export const getGraphData = (data) => {
  return request({
    url: '/neo/load_data',
    method: 'POST',
    data
  })
}

export const mergeGraphData = () => {
  return request({
    url: '/neo/merge',
    method: 'GET',
  })
}


export const getTreeData = () => {
  return request({
    url: '/neo/tree',
    method: 'GET',
  })
}

export const getNodes = () => {
  return request({
    url: '/neo/query_all_nodes',
    method: 'GET',
  })
}

export const getNodeInfo = (data) => {
  return request({
    url: '/neo/query',
    method: 'POST',
    data,
  })
}

export const addNode = (data) => {
  return request({
    url: '/neo/temporary_add',
    method: 'POST',
    data,
  })
}

export const deleteNode = (data) => {
  return request({
    url: '/neo/delete',
    method: 'DELETE',
    data,
  })
}

export const queryDocumentSegment = (data) => {
  return request({
    url: '/knowledge/document',
    method: 'POST',
    data,
  })
}

export const addKnowledge = (data) => {
  return request({
    url: '/knowledge/save',
    method: 'POST',
    data,
  })
}

export const updateKnowledge = (data) => {
  return request({
    url: '/knowledge/update',
    method: 'POST',
    data,
  })
}

export const deleteKnowledge = (data) => {
  return request({
    url: '/knowledge/action',
    method: 'DELETE',
    data,
  })
}

export const getKnowledge = () => {
  return request({
    url: '/knowledge/action',
    method: 'GET',
  })
}

export const getReviewData = (data, config = {}) => {
  return request({
    url: '/api/baoguandan',
    method: 'POST',
    data,
    ...config,
  })
}

export const getHscode = (data, config = {}) => {
  return request({
    url: '/api/hscode',
    method: 'POST',
    data,
    ...config,
  })
}

// 政策
export const getPolicies = (data, config = {}) => {
  return request({
    url: '/api/policies',
    method: 'GET',
    data,
    ...config,
  })
}

// 业务知识
export const getBusinessKnowledge = (data, config = {}) => {
  return request({
    url: '/api/knowledge',
    method: 'POST',
    data,
    ...config,
  })
}

// TODO:-----------------------------------------标签管理--------------------------------------------
export const addLabel = (data) => {
  return request({
    url: '/label/save',
    method: 'POST',
    data,
  })
}

export const updateLabel = (data) => {
  return request({
    url: '/label/update',
    method: 'POST',
    data,
  })
}

export const deleteLabel = (data) => {
  return request({
    url: '/label/action',
    method: 'DELETE',
    data,
  })
}

export const getLabels = (data) => {
  return request({
    url: '/label/list',
    method: 'POST',
    data,
  })
}



export const getNeoLabels = () => {
  return request({
    url: '/neo/query_label',
    method: 'GET',
  })
}

export const updateLabels = (data) => {
  return request({
    url: '/neo/update_label',
    method: 'POST',
    data
  })
}

